package com.epam.cdp.jpa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
@Entity
public class BookReservation extends BaseEntity {

    private static final long serialVersionUID = 1L;
    
    @Column(nullable = false)
    private BookReservationRequest request;
    
    @Column(nullable = false)
    private User librarian;
    
    @Column(nullable = false)
    private BookCopy bookCopy;
    
    @Temporal(TemporalType.DATE)
    @Column(nullable = false)
    private Date startDate;
    
    @Temporal(TemporalType.DATE)
    @Column(nullable = false)
    private Date endDate;
    
    @Column(nullable = false)
    private BookReservationStatus status;
}
